<%@page import="org.proddevplm.dao.data.requirements.Requirements"%>
<%@page import="org.proddevplm.constants.UserConstants"%>
<%@page import="org.proddevplm.dao.data.User"%>
<%@page import="org.proddevplm.dao.data.activities.Activity"%>
<%@page import="java.util.List"%>


<script>
	function loadNRPage(page) {
		$("#nrContent").load(page);
	}
	
	function populateContent(){
		
		loadNRPage("content/project/devTools/workspace/needReqs/nrGathering.jsp");
		
	}

</script>

<%
	List<Activity> activitiesForUser = (List)session.getAttribute("activitiesForUser");
	User user = (User)session.getAttribute(UserConstants.USER);
	List<Requirements> reqsByActName = (List)session.getAttribute("reqsByActName");
%>


<div class="pageTitle">
	<div style="text-align:left;">
		<a href="/proddev/controller?manager=dataAccessManager&method=21">
			<img src="/proddev/images/arrowleft.png" align="middle" height="20" width="30" style="border:0px"></a>
	</div>
	<p style="font-size:small; font-weight:bold; margin-top:-20px">Needs & Requirements</p>

</div>
<%if(reqsByActName==null){ %>
<div style="margin:10 0 0;">
	<div style="float:left; text-align:left; font-weight:bold; color:#555555">
		Please choose the activity you want to complete
	</div>
	<select class="regInput" id="activitySelect" name="activitySelect" onchange="populateContent()" size="1" style="width:25%; float:left; margin-left:10px">
		<option SELECTED>-select activity-</option>
		<%if(activitiesForUser!=null){
			for(int i=0; i<activitiesForUser.size(); i++) {
				Activity activity = (Activity)activitiesForUser.get(i);%>
				<option value="<%=activity.getName()%>"><%=activity.getName() %></option>
			<%}
		}
		%>		
	</select>
	<div style="clear:both"></div>
</div>

<div id="nrContent" style="margin:10 0 0">
</div>
<%}else{ %>
<div>
	<jsp:include page="nrSorting.jsp"></jsp:include>
</div>
<%}%>